package com.hebeu.xwl.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.JdbcType;

import java.util.List;
//@Data
//@AllArgsConstructor
//@NoArgsConstructor
public class Article {
    private int articleId;
    private String author;
    private String pubdate;
    private String pubtime;
    private String title;
    private String keywords;
    //private String content;
    private String href;
    private int likes;
    private int commentary;
    @TableField(value = "`views`")
    private int views;

    public Article() {
    }

    public int getArticleId() {
        return articleId;
    }

    public void setArticleId(int articleId) {
        this.articleId = articleId;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        author.replaceAll("\n"," ");
        author.replaceAll("\t"," ");
        this.author = author;
    }

    public String getPubdate() {
        return pubdate;
    }

    public void setPubdate(String pubdate) {
        pubdate.replaceAll("\n"," ");
        pubdate.replaceAll("\t"," ");
        this.pubdate = pubdate;
    }

    public String getPubtime() {
        return pubtime;
    }

    public void setPubtime(String pubtime) {
        pubtime.replaceAll("\n"," ");
        pubtime.replaceAll("\t"," ");
        this.pubtime = pubtime;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        title.replaceAll("\n"," ");
        title.replaceAll("\t"," ");
        this.title = title;
    }

    public String getKeywords() {
        return keywords;
    }

    public void setKeywords(String keywords) {
        keywords.replaceAll("\n"," ");
        keywords.replaceAll("\t"," ");
        this.keywords = keywords;
    }

    public String getHref() {
        return href;
    }

    public void setHref(String href) {
        href.replaceAll("\n"," ");
        href.replaceAll("\t"," ");
        this.href = href;
    }

    public int getLikes() {
        return likes;
    }

    public void setLikes(int likes) {
        this.likes = likes;
    }

    public int getCommentary() {
        return commentary;
    }

    public void setCommentary(int commentary) {
        this.commentary = commentary;
    }

    public int getViews() {
        return views;
    }

    public void setViews(int views) {
        this.views = views;
    }

    @Override
    public String toString() {
        return "Article{" +
                "articleId=" + articleId +
                ", author='" + author + '\'' +
                ", pubdate='" + pubdate + '\'' +
                ", pubtime='" + pubtime + '\'' +
                ", title='" + title + '\'' +
                ", keywords='" + keywords + '\'' +
                ", href='" + href + '\'' +
                ", likes=" + likes +
                ", commentary=" + commentary +
                ", views=" + views +
                '}';
    }

    public Article(int articleId, String author, String pubdate, String pubtime, String title, String keywords, String href, int likes, int commentary, int views) {
        this.articleId = articleId;
        this.author = author;
        this.pubdate = pubdate;
        this.pubtime = pubtime;
        this.title = title;
        this.keywords = keywords;
        this.href = href;
        this.likes = likes;
        this.commentary = commentary;
        this.views = views;
    }
    //    public String getKeywords() {
//        StringBuilder a = new StringBuilder();
//        for(String key:keywords)
//        {
//            a.append(key);
//
//        }
//        return a.toString();
//    }
//
//    public void setKeywords(List<String> keywords) {
//        this.keywords = keywords;
//    }

//    @Override
//    public String toString() {
//        return "Article{" +
//                "articleId=" + articleId +
//                ", author='" + author + '\'' +
//                ", pubdate='" + pubdate + '\'' +
//                ", pubtime='" + pubtime + '\'' +
//                ", title='" + title + '\'' +
//                ", keywords=" + keywords +
//                //", content='" + content + '\'' +
//                ", href='" + href + '\'' +
//                ", likes=" + likes +
//                ", commentary=" + commentary +
//                ", views=" + views +
//                '}';
//    }

}
